<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>  

<script type="text/javascript">

	$(document).ready(function(){
		
		$("#backBtn").click(function(){
			history.go(-1);
		});
		var gnameflag=false;
		$("#createF").submit(function(){
			if(gnameflag==false)
			{
			alert("GroupName 중복을 확인 하세요");
			return false;
			}
			
			});
		
	});
			
	
</script>

<script type="text/javascript">
function deleteMember(date)
{
	 
	$.ajax({
		type : "post",
		url : "${initParam.root}/member/groupBan.do",
		data:"id="+date,
		datatype:"json",
		success:function(data){
			alert("탈퇴 되었습니다");
			location.href="${initParam.root}/member/groupUpdateView.do";
			
		}
	});

}
</script>
<h2>
<a href="${initParam.root}/member/mypageMyInfo.do">Mypage</a>
<a href="${initParam.root}/member/mypageMyGroup.do">내 그룹</a>
<a href="${initParam.root}/member/mypageMyPoint.do?id=${sessionScope.mvo.id }">내 포인트</a>
<a href="${initParam.root}/member/mypageUpdateView.do">회원정보수정</a>
<a href="${initParam.root}/member/mypageDeleteView.do">회원탈퇴</a>
</h2>

<br>
<h1>Update Group</h1>
<form id="updateF" action="${initParam.root}/member/updateGroup.do" method="post">
<h3>GroupName &nbsp;&nbsp;&nbsp;|&nbsp; ${requestScope.map.groupinfo.gname }</h3>
<h3>GroupContent |&nbsp; <input type="text" name="gcontent$" value="${requestScope.map.groupinfo.gcontent }"></h3>
<h3>CreateDate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp; ${requestScope.map.groupinfo.gdate }</h3>
<h3>Member<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Count&nbsp; | &nbsp;${requestScope.map.groupinfo.amount } <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List <Br>
	<c:forEach items="${requestScope.map.list }" var="list">
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ID : ${list.id } &nbsp;| &nbsp;Level : ${list.level}&nbsp; |&nbsp; Tel : ${list.tel } &nbsp;|&nbsp; <input type="button" value="탈퇴" onclick="deleteMember(${list.id})"><Br>
	</c:forEach>
</h3>
<input type="submit" value="Update">&nbsp;&nbsp;&nbsp;
<input id="backBtn" type="button" value="Cancel">

</form>
